#include <iostream>

using namespace std;

class student_t {
  public:
    // 成员变量
    const char *name;
    int         age;
    float       score;
    // 成员函数
    void say()
    {
        cout << name << "的年龄是" << age << "，成绩是" << score << endl;
    }
};

int main()
{
    // 1. 定义对象
    student_t sumu;
    // 2. 使用 . 运算符访问成员
    sumu.name = "sumu";
    sumu.age = 15;
    sumu.score = 92.5f;
    sumu.say();

    // 3. 使用对象指针访问
    student_t *p = &sumu;
    p->name = "aaa";
    p->age = 25;
    p->score = 96.9f;
    p->say();

    // 4. 动态创建一个对象
    student_t *p1 = new student_t;
    p1->name = "bbb";
    p1->age = 22;
    p1->score = 95.9f;
    p1->say();

    delete p1;
    return 0;
}
